<template>
  <div class="main">
    <div class="title">
      系统消息
    </div>
    <div class="sign">
      <el-button size="medium">标记为已读</el-button>
    </div>
    <div>
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange">
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          label="状态"
          width="120"
          prop="state"
          header-align="center"
          align="center">

        </el-table-column>
        <el-table-column
          prop="name"
          label="邮件标题"
          width="200"
          header-align="center"
          align="center">
        </el-table-column>
        <el-table-column
          prop="content"
          label="邮件内容"
          header-align="center"
          align="center"
          show-overflow-tooltip>
        </el-table-column>
        <el-table-column
          prop="date"
          label="时间"
          header-align="center"
          align="center"
          width="200">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        tableData: [{
          state:'未读',
          date: '2016-05-03 15:15:15',
          name: '阿斯达四大',
          content: '阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大'
        }, {
          state:'未读',
          date: '2016-05-03 15:15:15',
          name: '阿斯达四大',
          content: '阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大'
        },
        {
          state:'未读',
          date: '2016-05-03 15:15:15',
          name: '阿斯达四大',
          content: '阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大'
        },
        {
          state:'未读',
          date: '2016-05-03 15:15:15',
          name: '阿斯达四大',
          content: '阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大'
        },
        {
          state:'未读',
          date: '2016-05-03 15:15:15',
          name: '阿斯达四大',
          content: '阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大阿斯达四大'
        }],
        multipleSelection: []
      }
    },
    methods: {
      toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      }
    }
  }
</script>
<style lang="scss" scoped>
.main{
  min-height: 755px;
}
.title {
    color: #F37B1D;
    font-weight: 700;
    padding-bottom: 16px;
    font-size: 18px;
    border-bottom: 1px #dedede solid;
}
.sign{
  margin: 20px;
}
</style>
